﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace YLPublicService
{
    ////除了登录都要使用guid验证
    [ServiceContract]
    public interface IAdminService : IServiceBase
    {
        /// <summary>
        /// 添加管理员帐户
        /// </summary>
        /// <param name="loginName"></param>
        /// <param name="pwd"></param>
        /// <param name="memo"></param>
        /// <param name="guid"></param>
        /// <returns></returns>
        [OperationContract]
        bool AddAdminUser(string loginName, string pwd, string memo, bool isAdmin, Guid guid);
        /// <summary>
        /// 绑定管理员所管理的用户
        /// </summary>
        /// <param name="serverUserLoginName"></param>
        /// <param name="guid"></param>
        [OperationContract]
        bool ConbindAll(string serverUserLoginName, Guid guid);
        /// <summary>
        /// 添加用户帐号
        /// </summary>
        /// <param name="loginName"></param>
        /// <param name="pwd"></param>
        /// <param name="memo"></param>
        /// <param name="guid"></param>
        /// <returns></returns>
        [OperationContract]
        bool AddUser(string loginName, string pwd, string userName, string memo, Guid guid);
        /// <summary>
        ///删除用户账户
        /// </summary>
        /// <param name="loginName"></param>
        /// <param name="guid"></param>
        /// <returns></returns>
        [OperationContract]
        bool DeleteUser(string loginName, Guid guid);
        /// <summary>
        /// 设置用户帐号可用
        /// </summary>
        /// <param name="loginName"></param>
        /// <param name="guid"></param>
        /// <returns></returns>
        [OperationContract]
        bool EnableUser(string loginName, Guid guid);
        /// <summary>
        /// 使账户不可用
        /// </summary>
        /// <param name="loginName"></param>
        /// <param name="guid"></param>
        /// <returns></returns>
        [OperationContract]
        bool DisableUser(string loginName, Guid guid);
        /// <summary>
        /// 获取管理员当前管理用户
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        [OperationContract]
        IEnumerable<TransferModel.User> GetUsers(Guid guid);
        /// <summary>
        /// 获取用户所有工作项
        /// </summary>
        /// <param name="userLoginName"></param>
        /// <param name="guid"></param>
        /// <returns></returns>
        [OperationContract]
        IEnumerable<TransferModel.WorkItem2ServerUser> GetWorkItems(string userLoginName, Guid guid);
        [OperationContract]
        IEnumerable<TransferModel.WorkItem2ServerUser> GetWaitingProcessWorkItems(string userLoginName, Guid guid);

        [OperationContract]
        void DeleteWorkItems(string userLoginName, Guid guid);
        [OperationContract]
        void DeleteWorkItem(string userLoginName, string boyName, string grilName, Guid guid);

        [OperationContract]
        bool UpdateWorkItem(int workItemID, YLPublicService.TransferModel.WorkItemStatus status, Guid guid);

        /// <summary>
        /// 更新用户金额
        /// 只有最高管理员才可以更新
        /// </summary>
        /// <param name="userLoginName"></param>
        /// <param name="money"></param>
        /// <param name="guid"></param>
        [OperationContract]
        void UpdateUserAccount(string userLoginName, decimal money, Guid guid);
        ///// <summary>
        ///// 请求获取ftp 服务器连接信息
        ///// </summary>
        ///// <param name="guid"></param>
        ///// <returns></returns>
        //[OperationContract]
        //TransferModel.FtpServerInfo RequestFtpServerInfo(Guid guid);

        /// <summary>
        /// 获取当前模板信息
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        [OperationContract]
        TransferModel.TemplateItem[] GetDisableTemplates(Guid guid);

        /// <summary>
        /// 更新模板信息
        /// </summary>
        /// <param name="?"></param>
        /// <param name="guid"></param>
        /// <returns></returns>
        [OperationContract]
        bool UpdateTemplate(TransferModel.TemplateItem item, Guid guid);
        /// <summary>
        /// 添加模板
        /// </summary>
        /// <param name="item"></param>
        /// <param name="guid"></param>
        /// <returns></returns>
        [OperationContract]
        bool AddTemplate(TransferModel.TemplateItem item, Guid guid);
        [OperationContract]
        bool DeleteTemplate(int templateID, Guid guid);
        /// <summary>
        /// 获取模板处理例程配置文件
        /// </summary>
        /// <param name="guid"></param>
        /// <param name="templateID"></param>
        /// <returns></returns>
        [OperationContract]
        TransferModel.Process GetTemplateProcessConfig(Guid guid, int templateID);

    }
}
